<Page
    x:Class="AppStudio.Views.BezirksgruppenPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:AppStudio.Views"
     xmlns:controls="using:AppStudio.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

  <Grid Background="{StaticResource AppBackground}">
    <Grid.ChildrenTransitions>
      <TransitionCollection>
        <EntranceThemeTransition/>
      </TransitionCollection>
    </Grid.ChildrenTransitions>

    <Grid.RowDefinitions>
      <RowDefinition Height="80"/>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <!-- Page title -->
    <Border x:Name="HeaderHost" Grid.Row="0">
      <ContentPresenter ContentTemplate="{StaticResource PageHeader}" />
    </Border>
    <TextBlock Grid.Row="1" Margin="24,0" Style="{StaticResource SubHeaderText}">Bezirksgruppen</TextBlock>

    <ScrollViewer Grid.Row="2" Margin="24" DataContext="{Binding BezirksgruppenModel}">
      <StackPanel>     
        <GridView  ItemsSource="{Binding Items}" SelectedItem="{Binding NavigationItem, Mode=TwoWay}"
                SelectionMode="Single" IsSwipeEnabled="False" ScrollViewer.VerticalScrollBarVisibility="Hidden"
                ItemTemplate="{StaticResource BezirksgruppenItem}">
       </GridView>
        <ProgressBar Width="400" Height="40" Foreground="White" IsIndeterminate="True" Visibility="{Binding ProgressBarVisibility}"></ProgressBar>
    </StackPanel>
  </ScrollViewer>

  </Grid>

  <Page.BottomAppBar>
    <CommandBar ClosedDisplayMode="Minimal" Visibility="{Binding BezirksgruppenModel.AppBarVisibility}" Background="{StaticResource AppBarBackground}">
      <AppBarButton DataContext="{Binding BezirksgruppenModel}" x:Uid="TextToSpeechButton" Visibility="{Binding TextToSpeechVisibility}"
                    Command="{Binding TextToSpeechCommand}">
        <AppBarButton.Icon>
          <BitmapIcon UriSource="ms-appx:///Assets/AppBar/TextToSpeech.png"/>
        </AppBarButton.Icon>
      </AppBarButton>
      <AppBarButton DataContext="{Binding BezirksgruppenModel}" x:Uid="RefreshButton" Visibility="{Binding RefreshVisibility}"
                    Command="{Binding RefreshCommand}">
        <AppBarButton.Icon>
          <BitmapIcon UriSource="ms-appx:///Assets/AppBar/Refresh.png"/>
        </AppBarButton.Icon>
      </AppBarButton>
      <CommandBar.SecondaryCommands>
        <AppBarButton x:Uid="ShareItemButton" Label="share item" DataContext="{Binding BezirksgruppenModel}" Visibility="{Binding ShareItemVisibility}" Command="{Binding ShareItemCommand}"/>
      </CommandBar.SecondaryCommands>
    </CommandBar>
  </Page.BottomAppBar>
</Page>
